import { SourceView } from './source_view'
import { TextModel, SelectionModel } from '../models'
export class SourceAndPreview extends SourceView {
  // previewElement_;
  constructor(textModel: TextModel, selectionModel: SelectionModel, viewContainer: HTMLElement) {
    super(textModel, selectionModel, viewContainer)
    const previewElement = document.createElement('pre')
    previewElement.setAttribute('class', 'container-pre preview')
    this.viewContainer_.parentElement!.appendChild(previewElement)
    // this.previewElement_ = previewElement
  }
  render() {
    this.viewContainer_.innerHTML = this.textModel_.getSpacers() + '\n'
    setTimeout(() => {
      this.domSelectionChangeHandler()
    }, 0);
  }
}